/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package atm;

import java.net.URL;
import java.util.ResourceBundle;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.text.Text;

/**
 *
 * @author henrikj
 */
public class WelcomeBackBalance implements Initializable {
    
    private int id;

    @FXML
    Text balancetext;
    
    DbHandler db = new DbHandler();
    
    private void setBalanceText() {
        int balance = db.checkBalance(id);
        balancetext.setText("Your balance is: "+ balance);
    }
    
    @Override
    public void initialize(URL url, ResourceBundle rb) {
        id=Context.getInstance().currentId().getUserId();
        setBalanceText();
    } 
}
